﻿Imports System.Windows.Forms

Public Class frmDescricao

    Private _Campo As String
    Private _Valor As String

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        _Campo = ""
        _Valor = ""

    End Sub

    WriteOnly Property Campo As String
        Set(value As String)
            _Campo = value.Trim
        End Set
    End Property
    Public Property Valor As String
        Get
            Return _Valor.Trim
        End Get
        Set(value As String)
            _Valor = value.Trim
        End Set
    End Property

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        _Valor = txtValor.Text
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub frmDescricao_Load(sender As Object, e As System.EventArgs) Handles Me.Load

        lblCampo.Text = _Campo & ":"
        Me.Text = _Campo
        Me.txtValor.Text = _Valor.Trim

    End Sub
End Class
